<template>
	<view class="whole">
		<view class="header">
			<image :src="dataimg" class="image"  mode="widthFix"></image>
		</view>
		<view class="dis">
			<view class="header_f">
				债务纠纷立案诉讼维权
			</view>
		</view>
		<view class="dis">
			<view class="service">
				法律顾问一对一服务
			</view>
		</view>
		<view class="card">
			<view class="dis view_border">
				<view class="footer">
					<view class="footer_header dis">
						法律顾问会1对1帮你
					</view>
					<view class="communicate">
						<view class="dia communicate_b">
							<view class="dot dis">1</view>
							<view class="details">微信 <text style="color: rgb(210, 64, 48);">一对一沟通,</text>详细了解案情</view>
						</view>
						<view class="dia communicate_b">
							<view class="dot dis">2</view>
							<view class="details"><text style="color: rgb(210, 64, 48);">借贷关系</text>要素审查与分析</view>
						</view>
						<view class="dia communicate_b">
							<view class="dot dis">3</view>
							<view class="details">债务违约情形及 <text style="color: rgb(210, 64, 48);">适用法律条款</text></view>
						</view>
						<view class="dia communicate_b">
							<view class="dot dis">4</view>
							<view class="details"><text style="color: rgb(210, 64, 48);">证据完备性分析</text>并沟通指导</view>
						</view>
						<view class="dia communicate_b">
							<view class="dot dis">5</view>
							<view class="details"><text style="color: rgb(210, 64, 48);">担保关系</text>和清偿顺序指导</view>
						</view>
						<view class="dia communicate_b">
							<view class="dot dis">6</view>
							<view class="details">案情总结和核心 <text style="color: rgb(210, 64, 48);">争议焦点聚焦</text></view>
						</view>
						<view class="dia communicate_b">
							<view class="dot dis">7</view>
							<view class="details">根据 <text style="color: rgb(210, 64, 48);">法院立案要求</text>委托查档</view>
						</view>
						<view class="dia communicate_b">
							<view class="dot dis">8</view>
							<view class="details"> <text style="color: rgb(210, 64, 48);">《民事起诉状》</text>起草并提交</view>
						</view>
						<view class="dia communicate_b">
							<view class="dot dis">9</view>
							<view class="details">证据整理及 <text style="color: rgb(210, 64, 48);">证据清单准备</text>和提交</view>
						</view>
						<view class="dia communicate_b">
							<view class="dot dis">10</view>
							<view class="details"> <text style="color: rgb(210, 64, 48);">《案情陈述发言》</text>和开庭指导</view>
						</view>
						<view class="dia communicate_b">
							<view class="dot dis">11</view>
							<view class="details"> <text style="color: rgb(210, 64, 48);">强制执行相关指导</text></view>
						</view>
					</view>
				</view>
				<view class="left_round"></view>
				<view class="right_round"></view>
			</view>
			<view class="dis">
				<view class="footer footer_bom">
					<view class="footer_header dis">过程中要求你这样做</view>
					<view class="communicate">
						<view class="dia communicate_b">
							<view class="dis">
								<image class="check" src="/static/checknumber.png" mode=""></image>
							</view>
							<view  class="details" style="font-size: 15px;">说真话，详细全面描述案件事实经过</view>
						</view>
						<view class="dia communicate_b">
							<view class="dis">
								<image class="check" src="/static/checknumber.png" mode=""></image>
							</view>
							<view  class="details" style="font-size: 15px;">日积极举证，并确保证据真实有力</view>
						</view>
						<view class="dia communicate_b">
							<view class="dis">
								<image class="check" src="/static/checknumber.png" mode=""></image>
							</view>
							<view  class="details" style="font-size: 15px;">积极配合，按法院要求准时出席开庭</view>
						</view>
					</view>
				</view>
				
			</view>
			<view class="bottom_b dis" style="    margin: 0px 16px;padding: 11px 17px;background: rgb(253, 235, 199);color: rgb(209, 61, 42);font-size: 15px;letter-spacing: 1px;">
				债务纠纷不要慌，做到这3条，就能走法院强制追索!
			</view>
		</view>
		<view class="pay_b dis">
			<view class="unit">{{price}}元</view>
			<view class="WeChatPay dis" @click="submite">微信支付</view>
		</view>
		<view style="background: rgb(238, 238, 238); height: 11px; margin-top: 13px;"></view>
		<view class="bottomf_box">
			<view class="bottom_head dia">
				<view class="dia">
					<view class="line_feedback"></view>
					<view class="evaluate">评价反馈</view>
				</view>
				<view class="dia reputation">
					<view class="">好评度 96%</view>
					<view class="dis">
						<image src="/static/arrow_right.png" mode="" class="image"></image>
					</view>
				</view>
			</view>
			<view class="tag dia">
				<view class="tag_b dis">好评(14)</view>
				<view class="tag_b dis">中评</view>
				<view class="tag_b dis">有图(6)</view>
				<view class="tag_b dis">回复及时</view>
				<view class="tag_b dis">服务专业</view>
				<view class="tag_b dis">服务高效</view>
				<view class="tag_b dis">性价比高</view>
				<view class="tag_b dis">耐心解答</view>
			</view>
			<view class="avater_b" v-for="(item,index) in dataList" :key="index">
				<view class="dia avatar">
					<view class="dis">
						<view class="u-avatar" style="background-color: transparent; width: 40px; height: 40px;">
							<image :src="item.avatar" mode="" style="width: 40px; height: 40px;border-radius: 100px;"></image>
						</view>
					</view>
					<view class="avatar_F">{{item.name}}</view>
				</view>
				<view class="tag_server dia">
					<view class="tag_server_b dis" v-for="(it,isn) in item.mark" :key="isn">{{it}}</view>
				</view>
				<view class="professional">
					<view class="">
						<jyf-parser :html="item.content" ref="article"></jyf-parser>
					</view>
					<view class="dia professional_img">
						<view class="dis">
							<image :src="item.proof" mode="" @click="yulan(item.proof)" class="image"></image>
						</view>
					</view>
				</view>
			</view>
			
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				title: 'Hello',
				code:'',
				id:'',
				price:'0',
				dataList:[],
				dataimg:''
			}
		},
		onLoad(e) {
			let that = this
			let result = ''
			result = e.data.split(/[ |\|]/)
			let local = location.href;
			if(!that.tui.isLogin()){
				let url=`https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxf67ea084bf852dc3&redirect_uri=`+encodeURIComponent(local)+`&response_type=code&scope=snsapi_base&state=STATE&connect_redirect=1#wechat_redirect`;
				window.location.href = url
			}
			that.price = result[0]
			that.id=result[1]
			that.code = that.getParam(local,'code')
			if(that.code){
				that.wetLogin()
			}
		},
		onShow() {
			this.getList()
			this.getImg()
		},
		methods: {
			wetLogin(){
				let that = this
				that.tui.request("api.login/wechat_in", "POST", {code: that.code}, false, false, false).then((res) => {
					if (res.code == 1) {
						uni.setStorageSync('token', res.data.info.token)
						window.location.href = "http://pay.zzcyx1688.net/h5/#/?price="+that.price+"&order_no="+that.id
					}
				}).catch((res) => {
				
				})
			},
			getImg(){
				
				let that = this
				that.tui.request("api.data/img", "POST", {}, false, false, false).then((res) => {
					if (res.code == 1) {
						that.dataimg = res.data.img
					}
				}).catch((res) => {
				
				})
			},
			yulan(e){
				let dataUrl = []
				dataUrl.push(e)
				uni.previewImage({
					current: 0,     // 当前显示图片的索引值
					urls: dataUrl,    // 需要预览的图片列表，photoList要求必须是数组
					loop:true,          // 是否可循环预览
				})
			},
			getList(){
				let that = this
				that.tui.request("api.data/proof", "POST", {}, false, false, false).then((res) => {
					if (res.code == 1) {
						that.dataList = res.data.list
					}
				}).catch((res) => {
				
				})
			},
			getParam(path, name) {
				  var reg = new RegExp("(^|\\?|&)" + name + "=([^&]*)(\\s|&|$)", "i");   
				  if (reg.test(path))  
				  return unescape(RegExp.$2.replace(/\+/g, " ")); 
				  return "";    
			},
			submite(){
				let that = this
				that.tui.request("api.auth.order/paymentRes", "POST", {order_no:that.id,price:that.price}, false, false, false).then((res) => {
					if (res.code == 1) {
						function onBridgeReady() {
							WeixinJSBridge.invoke(
								'getBrandWCPayRequest', {
									"appId": res.data.param.appId, //公众号名称，由商户传入     
									"timeStamp": res.data.param.timeStamp, //时间戳，自1970年以来的秒数     
									"nonceStr": res.data.param.nonceStr, //随机串     
									"package": res.data.param.package,
									"signType": res.data.param.signType, //微信签名方式：     
									"paySign": res.data.param.paySign, //微信签名 
								},
								function(res) {
									if (res.err_msg == "get_brand_wcpay_request:ok") {
										that.tui.toast('支付成功')
										setTimeout(function() {
											
										}, 1000)
										// 使用以上方式判断前端返回,微信团队郑重提示：
										// res.err_msg将在用户支付成功后返回ok，但并不保证它绝对可靠。
									}else{
										setTimeout(function() {
											
										}, 1000)
									}
								});
						}
						if (typeof WeixinJSBridge == "undefined") {
							if (document.addEventListener) {
								document.addEventListener('WeixinJSBridgeReady', onBridgeReady, false);
							} else if (document.attachEvent) {
								document.attachEvent('WeixinJSBridgeReady', onBridgeReady);
								document.attachEvent('onWeixinJSBridgeReady', onBridgeReady);
							}
						} else {
							onBridgeReady();
						}
					}
				}).catch((res) => {
				
				})
				
			},
		}
	}
</script>

<style lang="scss">
	page {
		background-color: #fdfcfa;
	}
	.bottomf_box{
	    padding: 13px 13px 77px 13px;
	    box-sizing: border-box;
	    background-color: #fafafa;
		.professional{
		    font-size: 14px;
		    padding-bottom: 13px;
		    border-bottom: 1px solid rgba(0,0,0,.12549019607843137);
		    margin-top: 6px;
		    margin-bottom: 14px;
			.professional_img{
				margin-top: 5px;
				.image{
				    width: 103px;
				    height: 103px;
				}
			}
		}
		.avatar{
		    color: #636363;
		    font-size: 15px;
		    margin-bottom: 5px;
			.u-avatar{
			    display: flex;
			    flex-direction: row;
			    align-items: center;
			    justify-content: center;
			}
			.avatar_F {
			    margin-left: 4px;
			    font-size: 15px;
			    color: #000;
			}
			
		}
		.tag_server{
			flex-wrap: wrap;
			.tag_server_b{
				font-size: 13px;
				background-color: #fcd89c;
				border-radius: 3px;
				padding: 2px 8px;
				margin-left: 5px;
				color: #000;
			}
			
		}
		.tag_server_b:nth-child(1) {
		    margin-left: 0px;
		}
		.tag{
			font-size: 13px;
			color: #d89993;
			flex-wrap: wrap;
			padding-top: 23px;
			margin-bottom: 13px;
			.tag_b{
			    padding: 0 6px;
			    border-radius: 3px;
			    margin-right: 6px;
			    border: 1px solid #e87f72;
			    margin-bottom: 13px;
			    flex-wrap: wrap;
			    line-height: 26px;
			    color: #e87f72;
			}
		}
		.bottom_head{
		    justify-content: space-between;
			.line_feedback{
			    width: 4px;
			    height: 18px;
			    background-color: #ea7d6c;
			    font-size: 15px;
			}
			.evaluate{
			    font-size: 15px;
			    margin-left: 3px;
			}
			.reputation{
			    font-size: 15px;
				.image{
				    width: 17px;
				    height: 17px;
				}
			}
		}
	}
	.header image{
		width: 100%;
		margin-bottom: 16px;
	}
	.dis{background-color: rgb(255, 255, 255);
		.header_f{
			font-size: 27px;
			color: #d92e0f;
			line-height: 41px;
			font-weight: 700;
		}
		.service{
			font-size: 15px;
		}
	}
	.dia{
	    display: flex;
	    align-items: center;
	}
	.dis{display: flex;align-items: center;justify-content: center;}
	.card{
		margin: 0 27px;
		margin-top: 15px;
		padding-bottom: 33px;
		border: 4px solid #f8df91;
		border-radius: 11px;
		overflow: hidden;
		.view_border{
			border-bottom: 1px dashed #918964;display: flex;align-items: center;justify-content: center;
			position: relative;
			.footer{
			    width: 100%;
			    padding-top: 16px;
			    box-sizing: border-box;
				.footer_header{
				    display: inline-block;
				    letter-spacing: 1px;
				    padding-left: 17px;
				    padding-right: 12px;
				    line-height: 28px;
				    border-radius: 0px 55px 55px 0px;
				    font-size: 18px;
				    color: #fff;
				    background-color: #fd5538;
				}
				.communicate{
				    margin: 0 19px;
				    margin-top: 19px;
				    position: relative;
					.communicate_b{
					    margin-bottom: 19px;
					}
					.dot{
					    font-size: 17px;
					    width: 20px;
					    height: 20px;
					    border-radius: 50%;
					    background-color: #fd5538;
					    color: #fff;
					}
					.details{
					    margin-left: 13px;
					}
				}
			}
			.left_round{
			    width: 13px;
			    height: 13px;
			    border-radius: 50%;
			    background: #f8df91;
			    position: absolute;
			    left: -6px;
			    bottom: -6px;
			}
			.right_round{
			    width: 13px;
			    height: 13px;
			    border-radius: 50%;
			    background: #f8df91;
			    position: absolute;
			    right: -6px;
			    bottom: -6px;
			}
		}
		.footer_bom{
			margin-top: 0px;    width: 100%;
			padding-top: 32px;
			.footer_header{
				display: inline-block;
				letter-spacing: 1px;
				padding-left: 17px;
				padding-right: 12px;
				line-height: 28px;
				border-radius: 0px 55px 55px 0px;
				font-size: 18px;
				color: #fff;
				background-color: #fd5538;
			}
			.communicate{
			    margin: 0 19px;
			    margin-top: 19px;
			    position: relative;
				.communicate_b{
				    margin-bottom: 19px;
				}
				.dot{
				    font-size: 17px;
				    width: 20px;
				    height: 20px;
				    border-radius: 50%;
				    background-color: #fd5538;
				    color: #fff;
				}
				.details{
				    margin-left: 13px;
				}
			}
		}
		
	}
	.check{
	    width: 20px;
	    height: 20px;
	}
	.pay_b{
	    width: 100%;
	    height: 77px;
	    margin-top: 17px;
	    background-color: #444243;
	    position: fixed;
	    bottom: 0;
	    z-index: 99;
		.unit {
		    font-size: 19px;
		    color: #fd5538;
		}
		.WeChatPay{
		    color: #fff;
		    width: 276px;
		    height: 49px;
		    background-color: #fd5538;
		    border-radius: 6px;
		    margin-left: 13px;
		}
	}
</style>